package org.dbcopy;

import org.dbcopy.domain.ApplicationParameters;
import org.dbcopy.service.Exporter;
import org.dbcopy.service.Importer;

public class DbCopy{

	public static void main(String parameterList[]){
		System.out.println("DbCopy start");

        // Prepare configuration parameters.
		ApplicationParameters ap = new ApplicationParameters();
		ap.setFileName("testZip.zip");
        ap.setNameOfUser("postgres");
        ap.setPassword("123");
        ap.setDbUrl("jdbc:postgresql://localhost:5432/postgres");
        ap.setZipPath("data.zip");

        // Export from database to ZIP file.
        Exporter exp = new Exporter(ap);
        exp.doExport();
		System.out.println("Export done");

        // Import tables data from a ZIP file.
        Importer imp = new Importer(ap);
        imp.doImport();
		System.out.println("Import done");

		System.out.println("DbCopy done");
	}
}